import {ControlType, FormBase} from './form-base';

export class FormLocation extends FormBase<string> {
    controlType: ControlType = 'location';
    length = 24;
    private _value = [];
    get value() {
        return this._value;
    }

    set value(location: any) {
        if (location) {
            if (typeof location === 'string') {
                this._value = [location];
            } else {
                this._value = location;
            }
        }
    }

    constructor(options: {} = {}) {
        super(options);
        if (options['value']) {
            this.value = options['value'];
        }
    }
}
